#ifndef __I2C_1_H__
#define __I2C_1_H__


#include "stm32f4xx.h"

#define EEPROM_I2C_GPIO_PORT    GPIOB
#define EEPROM_I2C_RCC_PORT     RCC_AHB1Periph_GPIOB
#define EEPROM_I2C_SDA_PIN      GPIO_Pin_7
#define EEPROM_I2C_SCL_PIN      GPIO_Pin_6



#define EEPROM_SCL_1()          GPIO_SetBits(EEPROM_I2C_GPIO_PORT,EEPROM_I2C_SCL_PIN)
#define EEPROM_SCL_0()          GPIO_ResetBits(EEPROM_I2C_GPIO_PORT,EEPROM_I2C_SCL_PIN)

#define EEPROM_SDA_1()          GPIO_SetBits(EEPROM_I2C_GPIO_PORT,EEPROM_I2C_SDA_PIN)
#define EEPROM_SDA_0()          GPIO_ResetBits(EEPROM_I2C_GPIO_PORT,EEPROM_I2C_SDA_PIN)

void I2C_Init1(void);
void AT24C02_Send_Byte(u8 addr,u8 data);
u8 AT24C02_Read_Byte(u8 addr);
void  I2C_Mode_Out();
void I2C_Mode_In();
void I2C_Start();
void I2C_Stop();
void I2C_Send_Byte(u8 data);
u8 I2C_Wait_Ack();
#endif